package com.imooc;

/**
 * @program: scala-JDBCtest
 * @description: SingleInstance
 * @author: zengchen
 * @create: 2021-04-22 17:02
 **/
public class SingleInstance {

    private SingleInstance(){}

    private static class SingleInner{
        private static SingleInstance singleInstance = new SingleInstance();
    }
    public static SingleInstance getSingleInstance(){
        return SingleInner.singleInstance;
    }

//    private static SingleInstance instance = null;
//
//    private SingleInstance() {}
//
//    public static SingleInstance getInstance() {
//        if(null == instance) {
//            instance = new SingleInstance();
//        }
//        return instance;
//    }

}
